import {getCurRouteDef, getParRouteDef} from "./routes";

export let curRouteMixin = {
  data() {
    return {
      $curRouteDef: null,
      $parRouteDef: null,
    }
  },
  computed: {
    $_curRouteDefChildren() {
      if (this.$curRouteDef) {
        return this.$curRouteDef?.children
      }
      return []
    },
    $_parRouteDefChildren() {
      if (this.$parRouteDef) {
        return this.$parRouteDef?.children
      }
      return []
    }
  },
  created() {
    // console.log(this.$route)
    this.$curRouteDef = getCurRouteDef(this.$route)
    this.$parRouteDef = getParRouteDef(this.$route)

    // console.log(this.$parRouteDef)
  },
}
